<?php
/**
 *      [迷你云] (C)2009-2012 南京恒为网络科技.
 *   软件仅供研究与学习使用，如需商用，请访问www.miniyun.cn获得授权
 * 
 */
?>
<?php

class MMediasController
extends MApplicationComponent
implements MIController
{
	
    public function invoke($uri = NULL) {
        parent::init();
        $url_manager = new MUrlManager();
        $path = $url_manager->parsePathFromUrl($uri);
        $root = $url_manager->parseRootFromUrl($uri);
        if ($path == false || $root == false) {
            throw new MFilesException(FXP::t(MConst::PATH_ERROR), MConst::HTTP_CODE_411);;
        }
        $path = "/" . $path;
                                $handler = MSharesBase::initSharesBase($path, $root);
        $handler->type = "media";         $handler->create();
        $handler->buildResult();
    }
}
?>